<template>
    <a-row>
      <a-col v-for="(item, index) in columns" :xl="24" :xxl="computedSpan(item)" :lg="24" :md="24" :sm="24" :xs="24" :key="index">
        <a-descriptions>
          <a-descriptions-item :label="item">
            <template v-if="link.includes(item)">
              <a @click="$router.push({path:'/orderStandardization/orderDetail',query:{id:dataList[columnMap[item]]}})">{{dataList[columnMap[item]]}}</a>
            </template>
            <template v-else-if="item === '地址'">
              {{dataList[columnMap[item]].shippingStreetLine1 + " " + dataList[columnMap[item]].shippingStreetLine2 + " " + dataList[columnMap[item]].shippingCity + " " + dataList[columnMap[item]].shippingRegion + " " + dataList[columnMap[item]].shippingPostcode }}
            </template>
            <template v-else-if="item === '自定义归因' || item === '首因' || item === '末因'">
              {{dataList[columnMap[item]].source ? dataList[columnMap[item]].source + "/" : ''}}
              {{dataList[columnMap[item]].medium ? dataList[columnMap[item]].medium + "/": ''}}
              {{dataList[columnMap[item]].campaign ? dataList[columnMap[item]].campaign : ''}}
            </template>
            <template v-else>
              {{dataList[columnMap[item]]}}
            </template>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
    </a-row>
</template>
<script setup>
import {statusMap} from "@utils/columnField.js";
const props = defineProps({
  columns: {
    type: Array,
    default: () => [],
  },
  dataList:{
    type: Array,
    default: () => [],
  },
  columnMap:{
    type: Object,
    default: () => {},
  },
  singleLine:{
    type:Array,
    default:()=>[]
  },
  link:{
    type:Array,
    default:()=>[]
  },
  isMoney:{
    type:Boolean,
    default:false
  }
})
const computedSpan = ((item)=>{
  if(props.singleLine.includes(item)){
    return 24
  }else{
    return 12
  }
})
</script>
<style scoped>

</style>
